<template>
  <div class="adeHistoryList">
    <el-table :data="tableData"  :span-method="objectSpanMethod" border style="width: 100%">
      <el-table-column prop="name" label="签到员工" width="120" header-align="center" align="center"/>
      <el-table-column prop="time" label="签到时间" header-align="center" align="center"/>
      <el-table-column prop="mark" label="签到标记" width="120" header-align="center" align="center" />
      <el-table-column prop="notes" label="签到备注" header-align="center" align="center"/>
      <el-table-column prop="department" label="所属部门" width="120" header-align="center" align="center"/>
      <el-table-column prop="institution" label="所属机构" header-align="center" align="center"/>
    </el-table>
  </div>
</template>

<script setup>


const tableData =[
  {
    name:'zhangsan',
    time:'2-3',
    mark:'签到',
    notes:'早上',
    department:'科学',
    institution:'航天',
  },
  {
    name:'zhangsan',
    time:'2-3',
    mark:'签到',
    notes:'早上',
    department:'科学',
    institution:'航天',
  },
  {
    name:'zhangsan',
    time:'2-3',
    mark:'签到',
    notes:'早上',
    department:'科学',
    institution:'航天',
  },
  {
    name:'zhangsan',
    time:'2-3',
    mark:'签到',
    notes:'早上',
    department:'科学',
    institution:'航天',
  },
]
const columnIndex = [0,4,5]
const objectSpanMethod = ({
  row,
  column,
  rowIndex,
  columnIndex,
}) => {
  if (columnIndex.value === 0 ) {
    if (rowIndex % 2 === 0) {
      return {
        rowspan: 2,
        colspan: 1,
      }
    } else {
      return {
        rowspan: 0,
        colspan: 0,
      }
    }
  }
}
</script>

<style scoped>

</style>
